home *** CD-ROM | disk | FTP | other *** search
/ Kentucky Virtual Art Museum / Kentucky Virtual Art Museum.iso / site / museums / zoomify / dog.swf / scripts / DefineSprite_50 / frame_1 / DoAction.as
Text File  |  2005-01-10  |  1KB  |  41 lines

  1. function StartDragLabel(launchURL)
  2. {
  3.    if(this.gLabelsEditableFlag == true)
  4.    {
  5.       this.gStartTextX = this._parent._x;
  6.       this.gStartTextY = this._parent._y;
  7.       this.gStartLabelX = this.gGraphicMovieClip._x;
  8.       this.gStartLabelY = this.gGraphicMovieClip._y;
  9.       this.gLabelDragIntervalID = setInterval(this,"LabelIsDragging",10);
  10.       this._parent.startDrag();
  11.    }
  12.    else if(this.gZoomifyURL != undefined && this.gZoomifyURL != "")
  13.    {
  14.       getURL(this.gZoomifyURL,"_blank");
  15.    }
  16. }
  17. function StopDragLabel()
  18. {
  19.    if(this.gLabelsEditableFlag == true)
  20.    {
  21.       this._parent.stopDrag();
  22.       clearInterval(this.gLabelDragIntervalID);
  23.       if(this.gLabelMovedCallback != "")
  24.       {
  25.          var xRI = Math.round(10000 * (this.gBackgroundTierWidth / 2 - this._parent._x) / this.gBackgroundTierWidth) / 10000;
  26.          var yRI = Math.round(10000 * (this.gBackgroundTierHeight / 2 - this._parent._y) / this.gBackgroundTierHeight) / 10000;
  27.          this.gLabelMovedCallback(xRI,yRI);
  28.       }
  29.    }
  30. }
  31. function LabelIsDragging()
  32. {
  33.    this.gGraphicMovieClip._x = this.gStartLabelX + (this._parent._x - this.gStartTextX);
  34.    this.gGraphicMovieClip._y = this.gStartLabelY + (this._parent._y - this.gStartTextY);
  35. }
  36. var gStartLabelX;
  37. var gStartLabelY;
  38. var gStartTextX;
  39. var gStartTextY;
  40. var gLabelDragIntervalID;
  41.